<template>
  <div>
    <span v-for="(item, index) in arr" :key="index">
      <label>
        <input type="checkbox" v-model="newArr"  :value="item"/>
        {{ item }}
      </label>
    </span>
    <p>和：{{ allNum }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      newArr: []
    };
  },
  computed: {
    allNum() {
      return this.newArr.reduce((sum, item) => (sum + item), 0);
    },
  },
};
</script>

<style>
</style>